
/*
 * This is the extension activity for a 'SilentAction' activity associated
 * with service '{http://www.pi4soa.org/AuctionHouseSeller}AuctionHouse'
 * and behavior 'main'. The name of the
 * activity is 'Initialize'.
 */
package org.pi4soa.auctionhouseseller.auctionhouse.main;

import java.io.File;

import org.pi4soa.service.extensions.DefaultActivityExtension;
import org.pi4soa.service.extensions.SilentActivityExtension;
import org.pi4soa.service.extensions.ExtensionContext;
import org.pi4soa.service.ServiceException;
import org.pi4soa.service.DeferProcessingException;

import dk.itu.amds.auctionhouse.data.AuctionHouseDB;

/**
 * This class has been autogenerated to implement the custom
 * activity within a service endpoint description.
 */
public class InitializeActivity extends DefaultActivityExtension
					implements SilentActivityExtension {

	/**
	 * The constructor for the activity extension.
	 */
	public InitializeActivity() {
	}
	
	/**
	 * This method enables an activity extension to
	 * perform activities that are not observable.
	 * 
	 * @param context The context
	 * @exception DeferProcessingException Suspend processing
	 * @exception ServiceException Failed to perform silent action
	 */
	public void process(ExtensionContext context)
				throws DeferProcessingException, ServiceException {

		
		File file = new File(AuctionHouseDB.AUCTION_HOUSE_DB_FILE);
		
		if (file.exists())
			file.delete();
		
	}
}	